package com.team.employment.web.app.controller.company;

import com.team.employment.common.result.Result;
import com.team.employment.model.entity.RecruitmentInfo;
import com.team.employment.web.admin.service.RecruitmentInfoService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Tag(name = "企业&招聘信息管理")
@RestController
@RequestMapping("/app/companyRecruitment")
public class CompanyRecruitmentController {
    @Autowired
    private RecruitmentInfoService recruitmentInfoService;

    @Operation(summary = "添加或修改对应企业的招聘信息")
    @PostMapping("saveOrUpdate")
    public Result saveOrUpdate(@RequestBody RecruitmentInfo recruitmentInfo){
        recruitmentInfoService.saveOrUpdate(recruitmentInfo);
        return Result.ok();
    }

    @Operation(summary = "根据recruitment_id得到招聘信息")
    @GetMapping("getRecruitmentInfoById/{id}")
    public Result<RecruitmentInfo> getRecruitmentInfoById(@PathVariable Long id){
        RecruitmentInfo list = recruitmentInfoService.getRecruitmentInfoById(id);
        return Result.ok(list);
    }

}
